﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class TextFieldExtensions
    {
        public static void SetText(this TextField textField, string text, bool append = false)
        {
            if (append)
            {
                textField.AppendText(text);
            }
            else
            {
                textField.SetAttributeValue("value", text);
            }
        }

        public static void TypeText(this TextField textField, string text, bool append = false)
        {
            if (append)
            {
                textField.AppendText(text);
            }
            else
            {
                textField.TypeText(text);
            }
        }
    }
}
